﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ExpressHelps.Model;
using ExpressHelps.DAL;
using System.Data;

namespace ExpressHelps.BLL.Task
{
    // 具体任务类型 - DeliveryTask
    public class DeliveryTask : Tasks
    {
        //构造函数，创建一个DeliveryTask对象
        public DeliveryTask(string des, string address, int money)
        {
            task_id = LoginUsers.taskId;
            task_type = TaskType.Delivery;
            task_description = "这是一个Delivery类型的任务：" + des;//
            task_publisher_id = LoginUsers.userId;////id为调用者id
            task_receiver_id = -1;//如果没有接单者，就是-1
            task_address = address;
            task_publish_time = DateTime.Now;
            task_receive_time = DateTime.MinValue;
            task_isreceiver = false;//false
            task_iscomplete = false;//false
            task_money = money;
            LoginUsers.taskId++;//任务id自增
        }
        // 可以根据实际需求添加 DeliveryTask 特有的属性和方法
    }

    // 具体任务类型 - TakeoutTask
    public class TakeoutTask : Tasks
    {
        // 可以根据实际需求添加 TakeoutTask 特有的属性和方法
        public TakeoutTask(string des, string address, int money)
        {
            task_id = LoginUsers.taskId;
            task_type = TaskType.Delivery;
            task_description = "这是一个Takeout类型的任务：" + des;//
            task_publisher_id = LoginUsers.userId;////id为调用者id
            task_receiver_id = null;
            task_address = address;
            task_publish_time = DateTime.Now;
            task_receive_time = null;
            task_isreceiver = false;//false
            task_iscomplete = false;//false
            task_money = money;
            LoginUsers.taskId++;//任务id自增
        }
    }
}
